/**
 * This file is part of 1genia trampoline
 * Copyright (C) 2007 1genia (contact@1genia.com)
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; version 3 of the License.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; see the file COPYING.TXT.  If not,
 * write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301, USA.
 **/
package com.genia.toolbox.config.autoconfiguration.bean;

/**
 * bean containing configuration data for the database.
 */
public class DatabaseConfigurationBean {
	/**
	 * the default JDBC url for the database.
	 */
	public static final String DEFAULT_URL = "jdbc:derby:${contentDirectory}/derbyDb";

	/**
	 * the default JDBC driver for the database.
	 */
	public static final String DEFAULT_DRIVER = "org.apache.derby.jdbc.EmbeddedDriver";

	/**
	 * the default login for the database.
	 */
	public static final String DEFAULT_LOGIN = "derby";

	/**
	 * the default password for the database.
	 */
	public static final String DEFAULT_PASSWORD = "derby";

	/**
	 * whether to activate the encryption of the password.
	 */
	public static final Boolean DEFAULT_ENCRYPTED = Boolean.FALSE;

	/**
	 * whether to update the schema when the server starts.
	 */
	public static final Boolean DEFAULT_SCHEMA_UPDATE = Boolean.TRUE;

	/**
	 * whether to activate second level cache.
	 */
	public static final Boolean DEFAULT_ACTIVATE_SECOND_LEVEL_CACHE = Boolean.TRUE;

	/**
	 * the JDBC url for the database.
	 */
	private String url = DEFAULT_URL;

	/**
	 * the JDBC driver for the database.
	 */
	private String driver = DEFAULT_DRIVER;

	/**
	 * the login for the database.
	 */
	private String login = DEFAULT_LOGIN;

	/**
	 * the password for the database.
	 */
	private String password = DEFAULT_PASSWORD;

	/**
	 * whether to encrypt the password into the configuration file.
	 */
	private Boolean encrypted = DEFAULT_ENCRYPTED;

	/**
	 * whether to update the schema when the server starts.
	 */
	private Boolean schemaUpdate = DEFAULT_SCHEMA_UPDATE;

	/**
	 * whether to active second level cache.
	 */
	private Boolean activateSecondLevelCache = DEFAULT_ACTIVATE_SECOND_LEVEL_CACHE;

	/**
	 * getter for the driver property.
	 * 
	 * @return the driver
	 */
	public String getDriver() {
		return driver;
	}

	/**
	 * setter for the driver property.
	 * 
	 * @param driver
	 *            the driver to set
	 */
	public void setDriver(String driver) {
		this.driver = driver;
	}

	/**
	 * getter for the login property.
	 * 
	 * @return the login
	 */
	public String getLogin() {
		return login;
	}

	/**
	 * setter for the login property.
	 * 
	 * @param login
	 *            the login to set
	 */
	public void setLogin(String login) {
		this.login = login;
	}

	/**
	 * getter for the password property.
	 * 
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * setter for the password property.
	 * 
	 * @param password
	 *            the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * getter of the encrypted property.
	 * 
	 * @return the encrypted property
	 */
	public Boolean getEncrypted() {
		return encrypted;
	}

	/**
	 * setter of the encrypted property.
	 * 
	 * @param encrypted
	 *            the encrypted to set
	 */
	public void setEncrypted(Boolean encrypted) {
		this.encrypted = encrypted;
	}

	/**
	 * getter for the url property.
	 * 
	 * @return the url
	 */
	public String getUrl() {
		return url;
	}

	/**
	 * setter for the url property.
	 * 
	 * @param url
	 *            the url to set
	 */
	public void setUrl(String url) {
		this.url = url;
	}

	/**
	 * getter for the schemaUpdate property.
	 * 
	 * @return the schemaUpdate
	 */
	public Boolean getSchemaUpdate() {
		return schemaUpdate;
	}

	/**
	 * setter for the schemaUpdate property.
	 * 
	 * @param schemaUpdate
	 *            the schemaUpdate to set
	 */
	public void setSchemaUpdate(Boolean schemaUpdate) {
		this.schemaUpdate = schemaUpdate;
	}

	/**
	 * getter for the activateSecondLevelCache property.
	 * 
	 * @return the activateSecondLevelCache
	 */
	public Boolean getActivateSecondLevelCache() {
		return activateSecondLevelCache;
	}

	/**
	 * setter for the activateSecondLevelCache property.
	 * 
	 * @param activateSecondLevelCache
	 *            the activateSecondLevelCache to set
	 */
	public void setActivateSecondLevelCache(Boolean activateSecondLevelCache) {
		this.activateSecondLevelCache = activateSecondLevelCache;
	}

}
